﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo02
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] arr = new double[5];
            double sum = 0;
            double avg = 0;
            Console.WriteLine("请输入学生的成绩：");
            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = double.Parse(Console.ReadLine());
            }

            foreach (var item in arr)
            {
                sum = sum + item;
            }
            avg = sum / arr.Length;

            Console.WriteLine("总成绩为："+ sum);
            Console.WriteLine("平均分为："+ avg);
        }
    }
}
